<?php
	class projects
	{
		var $id_projects, $image, $title, $creation_date, $change_date, $last_project, $state;
		
		public function __construct($id_projects)
		{
			global $db;

			$results = $db->query("select * from projects where id_projects='".$id_projects."' LIMIT 1");
			$data = $db->fetch($results);
			
			$this->id_projects= (int) $data["id_projects"];
			$this->image = $data["image"];
			$this->title = $data["title"];
			$this->creation_date = (int) $data["creation_date"];
			$this->change_date = (int) $data["change_date"];
			$this->last_project = $data["last_project"]=='-1'?false:(int)$data["last_project"];
			$this->param = explode(':',$data['state']);
		}
	}
?>